package com.acheli.rideable.functionLathes.component.engine;




import com.acheli.rideable.entites.RideableEntity;
import net.minecraft.client.Minecraft;
import net.minecraft.network.chat.Component;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.phys.Vec3;


public class ModTestEngine extends EngineFL {

    public ModTestEngine(RideableEntity masterRideable, String ID, Vec3 relativePosition) {
        super(ID, masterRideable, relativePosition, 60, 55, 200, 50, 60);
    }

    void testClientPrint(String str) {
        String msg = "";
        msg += ID + this.hashCode() + str;
        System.out.println(msg);
    }

    @Override
    public void tick() {
        super.tick();
    }

    @Override
    public void engineRunning() {
        super.engineRunning();
    }

    @Override
    public void engineStopping() {
        super.engineStopping();
        testClientPrint("stopping");
    }

    @Override
    public void engineSwitch() {
        super.engineSwitch();
    }

    @Override
    public void onEngineIsReady() {
        testClientPrint("lowest at:" + getRevolutionSpeed());
    }

    @Override
    public void onEngineMaxed() {
        testClientPrint("ok at:" + getRevolutionSpeed());
        Player player = Minecraft.getInstance().player;
        if (player != null) {
            player.sendSystemMessage
                    (Component.literal("Engine successfully started."));
        }
    }

    @Override
    public void onEngineClosed() {
        super.onEngineClosed();
        testClientPrint("shutdown at:" + getRevolutionSpeed());
        Player player = Minecraft.getInstance().player;
        if (player != null) {
            player.sendSystemMessage
                (Component.literal("Engine has been turned off."));
        }
    }
}
